package demo2;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource("classpath:config.properties")
public class UserMapper {
    //下面三个信息用于连接数据库
    @Value("${spring.url}")
    private String url;
    @Value("${spring.username}")
    private String username;
    @Value("${spring.password}")
    private String password;

    @Override
    public String toString() {
        return "UserMapper{" +
                "url='" + url + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
